<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
      function alphabetPosition(text) {
  text = text
    .toLowerCase()
    .replace(
      /[\ |\~|\`|\!|\@|\#|\$|\%|\^|\&|\*|\(|\)|\-|\_|\+|\=|\||\\|\[|\]|\{|\}|\;|\:|\"|\'|\,|\<|\.|\>|\/|\?|0-9]/g,
      ""
    );
      var ans = "";
  for (let i = 0; i < text.length; i++) {
          if (i == text.length - 1) {
      ans += Number(text[i].charCodeAt() - 96);
    } else {
      ans += Number(text[i].charCodeAt() - 96) + " ";
    }
  }
  return ans;
}
console.log(alphabetPosition("The sunset sets at twelve o' clock."))
    </script>
</body>
</html>